# Contributor: Olliver Schinagl <oliver@schinagl.nl>
# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
pkgname="tpm2-abrmd"
pkgver="2.3.2"
pkgrel=0
pkgdesc="TPM2 Access Broker & Resource Management Daemon implementing the TCG spec."
url="https://github.com/tpm2-software/tpm2-abrmd"
arch="all"
license="BSD-2-Clause"
depends="libtss2-tcti-armbd"
makedepends="
	autoconf
	autoconf-archive
	automake libtool
	glib-dev
	tpm2-tss-dev
"
options="!check"  # Requires IBM TPM simulator
subpackages="libtss2-tcti-armbd:libs ${pkgname}-dev ${pkgname}-doc"
source="${pkgname}-${pkgver}.tar.gz::https://github.com/tpm2-software/tpm2-abrmd/archive/${pkgver}.tar.gz"

prepare() {
	default_prepare
	echo "${pkgver}" > "VERSION"
	autoreconf --install --sym
}

build() {
	./configure \
		--build="${CBUILD}" \
		--host="${CHOST}" \
		--prefix="/usr"
	make
}

package() {
	make DESTDIR="${pkgdir}" install
}

sha512sums="f6c87e820890a082ce99da4ec9d71a4f084d1ff86f9ed66bebadc35762b1ce1954ab295e839444a09df76970ab17b47c7d49676a3d0355aaeee931a53980ea5b  tpm2-abrmd-2.3.2.tar.gz"
